<!DOCTYPE html>
<html ng-app="hubSearch">
  <head>
    <title>HubSearch</title>
    <link rel="stylesheet" href="dist/app.css"/>
    
    <script>
      var _languages = ["JavaScript","ActionScript","Ada","Apex","Arc","Arduino","ASP","Assembly","Augeas","AutoHotkey","Boo","Bro","C","C#","C++","Ceylon","Clojure","CoffeeScript","ColdFusion","Common Lisp","Coq","D","Dart","DCPU-16 ASM","Delphi","Dylan","eC","Eiffel","Elixir","Emacs Lisp","Erlang","F#","Factor","Fancy","Fantom","FORTRAN","Go","Gosu","Groovy","Haskell","HaXe","Io","Ioke","Java","Julia","Kotlin","Logtalk","Lua","Matlab","Max/MSP","Mirah","Nemerle","Nimrod","Nu","Objective-C","Objective-J","OCaml","ooc","Opa","OpenEdge ABL","Parrot","Perl","PHP","PowerShell","Prolog","Puppet","Pure Data","Python","R","Racket","Rebol","Ruby","Rust","Scala","Scheme","Scilab","Self","Shell","Smalltalk","Standard ML","SuperCollider","Tcl","Turing","Vala","Verilog","VHDL","VimL","Visual Basic","XQuery"];
    </script>
    <script src="dist/app.js"></script>
  </head>
  <body ng-controller="HubSearchController">
   
    <div class="navbar">
      <div class="navbar-inner">
        <div class="container-fluid">
          <a href="#" class="brand">HubSearch</a>
        </div>
      </div>
    </div>
    <div class="container-fluid" ng-controller="SearchBoxController">
      <div class="row-fluid">
        <form class="well form-search" ng-submit="onSubmit()">
          <div class="span4">
            <input ng-model="inputQuery" type="text" placeholder="Search for repo..." autofocus="autofocus">
          </div>
          <div class="span4">
            <select ng-model="inputLanguage" ui-select2 style="width: 100%">
              <option ng-repeat="lang in languages" value="{{lang}}">{{lang}}</option>
            </select>
          </div>
          <div class="span4">
            <button type="submit" class="btn btn-primary">Search</button>
          </div>
        </form>
      </div>
      <div class="row-fluid">
        <div ng-view></div>
      </div>
    </div>
    <script id="searchResults.html" type="text/ng-template">
      <div class="results">
        <div class="loading" ng-show="searching">Searching Github...</div>
        <table class="table table-striped" ng-show="repos">
          <thead>
            <tr>
              <th ng-click="sortKey='name'">Repo</th>
              <th ng-click="sortKey='-pushed_at'">Last Commit</th>
              <th ng-click="sortKey='-watchers'">Stars</th>
              <th ng-click="sortKey='-forks'">Forks</th>
              <th ng-click="sortKey='-score'">Score</th>
              <th ng-click="sortKey='githubRank'">Github Rank</th>
              <th>Author</th>
            </tr>
          </thead>
          <tbody>
            <tr ng-repeat="repo in repos | orderBy:sortKey">
              <td class="name">
                <a href="https://github.com/{{repo.username}}/{{repo.name}}">{{repo.name}}</a>
                <p>{{repo.description}}</p>
              </td>
              <td>{{repo.pushed_at|relativeDate}}</td>
              <td>{{repo.watchers}}</td>
              <td>{{repo.forks}}</td>
              <td>{{repo.score}}</td>
              <td>{{repo.githubRank}}</td>
              <td>
                <a href="http://github.com/{{repo.username}}">{{repo.username}}</a>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </script>
    <div class="footer">
      
     
    </div>
  </body>
</html>
